# - Try to find libdrm library
#

find_path(DRM_INCLUDE_DIR drm.h
   HINTS /usr/include/libdrm
)

find_library(DRM_LIBRARY NAMES libdrm.so
   HINTS /usr/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu
)

find_library(GBM_LIBRARY NAMES libgbm.so
   HINTS /usr/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu
)

set(DRM_LIBRARIES ${DRM_LIBRARY} ${GBM_LIBRARY} )
set(DRM_INCLUDE_DIRS ${DRM_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)

# handle the QUIETLY and REQUIRED arguments and set DRM_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(DRM DEFAULT_MSG DRM_LIBRARY DRM_INCLUDE_DIR)

mark_as_advanced(DRM_INCLUDE_DIR DRM_LIBRARY)
